﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{$user.store.name} - {:seo('title')}</title>
    <link rel="stylesheet" href="/static/hqui/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="/static/hqui/module/admin.css"/>
    <!-- 风格 -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="theme-blue" data-theme="theme-blue">
<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <div class="layui-header">
        <div class="layui-logo">
            <cite>{$user.store.name}</cite>
        </div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-href="/user/index/renew" title="系统续期"><i class="layui-icon layui-icon-time"></i> 有效期：{$user.store.exp_time}</a>
            </li>
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-event="message" data-url="/store/notice/message" title="消息">
                    <i class="layui-icon layui-icon-notice"></i>
                    <span class="layui-badge-dot" id="notice"></span><!--小红点-->
                    最新消息
                </a>
            </li>
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i> 全屏显示</a>
            </li>
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-href="{:url('store/index/clear')}" title="清除缓存"><i class="layui-icon layui-icon-fonts-clear"></i> 清除缓存</a>
            </li>
            <li class="layui-nav-item" lay-unselect style="margin-right: 25px;">
                <a>
                    <i class="layui-icon layui-icon-user"></i>
                    <cite>{$user.store.admin_id == $user.id?'(超级管理员) ':''}{$user.name}</cite>
                </a>
                <dl class="layui-nav-child">
                    <dd lay-unselect>
                        <a ew-event="open" data-type="2" data-content="{:url('store/user/edit_password')}">修改密码</a>
                    </dd>
                    <hr>
                    <dd lay-unselect>
                        <a ew-event="logout" data-url="{:url('store/index/logout')}">退出</a>
                    </dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <i class="layui-icon layui-icon-more-vertical"></i>
            </li>

        </ul>
    </div>

    <!-- 侧边栏 -->
    <div class="layui-side">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree" lay-filter="admin-side-nav" lay-shrink="_all">
                {foreach name="navbar" item="v"}
                <li class="layui-nav-item">
                    <a {if isset($v['children'])}href="javascript:;"{else}lay-href="{:url($v.url)}"{/if}><i class="layui-icon {$v.icon}"></i>&emsp;<cite>{$v.name}</cite></a>
                    {if isset($v['children'])}
                    <dl class="layui-nav-child">
                        {foreach name="v['children']" item="n1"}
                        <dd>
                            <a {if isset($n1['children'])}href="javascript:;"{else}lay-href="{:url($n1.url)}"{/if}>{$n1.name}</a>
                            {if isset($n1['children'])}
                            <dl class="layui-nav-child">
                                {foreach name="n1['children']" item="n2"}
                                <dd><a lay-href="{:url($n2.url)}">{$n2.name}</a></dd>
                                {/foreach}
                            </dl>
                            {/if}
                        </dd>
                        {/foreach}
                    </dl>
                    {/if}
                </li>
                {/foreach}
            </ul>
        </div>
    </div>

    <!-- 主体部分 -->
    <div class="layui-body"></div>
    <!-- 底部 -->
    <div class="layui-footer">
        copyright © 2021 <a href="http://www.ennn.cn" target="_blank">六诺科技</a> all rights reserved.
        <span class="pull-right">客服热线: 400-6622-003</span>
    </div>

</div>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- js部分 -->
<script type="text/javascript" src="/static/hqui/libs/layui/layui.js"></script>
<script type="text/javascript" src="/static/hqui/js/common.js"></script>
<script>


    layui.use(['index'], function () {
        var $ = layui.jquery;
        var index = layui.index;
        $('#notice').hide();
        // 默认加载主页
        index.loadHome({
            menuPath: '/store/index/home',
            menuName: '<i class="layui-icon layui-icon-home"> </i>'
        });
        $('.layui-body>.layui-tab[lay-filter="admin-pagetabs"]').attr('lay-autoRefresh', 'true');
        //开启轮询
        setInterval("test()",60000);
    });
    //查询通知
    function test() {
        layui.use(['notice'], function () {
            var $ = layui.jquery;
            var notice = layui.notice;
            $.ajax({
                url: "{:url('store/index/get_notice')}",
                async:true,
                type: 'get',
                success: function (res) {
                    console.log(res.data);
                    if (res.data >'0'){
                        $('#notice').show();
                        notice.warning({
                            title: '消息通知',
                            message: '你今天有'+res.data+'条新的提醒待处理,请及时处理!',
                            audio:'5',
                            position:'bottomRight',
                            balloon:true,
                        });
                    }
                }
            })
        });
    }
</script>
</body>
</html>